#pragma once

#include <stdio.h>   // for perror()
#include <stdlib.h>  // for exit() and EXIT_FAILURE

void errif(bool condition, const char* errmsg) {
    if (condition) {
        perror(errmsg);
        exit(EXIT_FAILURE);
    }
}
